home *** CD-ROM | disk | FTP | other *** search
/ Champak 40 / Vol 40.iso / games / super_su.swf / scripts / DefineSprite_760 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-04-19  |  1.7 KB  |  86 lines

  1. function mSetCharacter(astrchar)
  2. {
  3.    this.strChar = astrchar;
  4. }
  5. function mResumeLevel()
  6. {
  7.    this.sndFondo.stop();
  8.    this.gotoAndPlay("game");
  9. }
  10. function mStartGame()
  11. {
  12.    this.intLevel = 0;
  13.    this.intScore = 0;
  14.    this.intLives = this.intmaxLives;
  15.    this.sndIntro.stop();
  16.    this.sndIntroLoop.stop();
  17.    this.sndFondo.stop();
  18.    this.sndFondo.start(0,9999);
  19.    this.gotoAndPlay("selection");
  20. }
  21. function mAddLife()
  22. {
  23.    this.intLives = this.intLives + 1;
  24.    if(this.intLives > this.intmaxLives)
  25.    {
  26.       this.intLives = this.intmaxLives;
  27.    }
  28. }
  29. function mLooseLife()
  30. {
  31.    this.intLives--;
  32.    if(this.intLives < 0)
  33.    {
  34.       this.mGameOver();
  35.    }
  36.    else
  37.    {
  38.       this.gotoAndPlay("vida");
  39.    }
  40. }
  41. function mGameOver()
  42. {
  43.    this.sndFondo.start(0,9999);
  44.    this.gotoAndPlay("gameover");
  45. }
  46. function mJumpLevel()
  47. {
  48.    this.intLevel = this.intLevel + 1;
  49.    this.mDisplayLevel();
  50. }
  51. function mColorSelect()
  52. {
  53.    this.gotoAndPlay("color");
  54. }
  55. function mDisplayLevel()
  56. {
  57.    if(this.intLevel > this.intLevels)
  58.    {
  59.       this.sndFondo.start(0,9999);
  60.       this.gotoAndPlay("finish");
  61.    }
  62.    else if(this.intLevel == 1)
  63.    {
  64.       this.mResumeLevel();
  65.    }
  66.    else
  67.    {
  68.       this.sndFondo.start(0,9999);
  69.       this.gotoAndPlay("jumplevel");
  70.    }
  71. }
  72. function mAddScore(intscore)
  73. {
  74.    this.intScore += intscore;
  75. }
  76. this.intmaxLives = 3;
  77. this.sndIntro = new Sound(this);
  78. this.sndIntro.attachSound("intro_loopeable.wav");
  79. this.sndIntroLoop = new Sound(this);
  80. this.sndIntroLoop.attachSound("intro_loop.wav");
  81. this.sndFondo = new Sound(this);
  82. this.sndFondo.attachSound("base_global");
  83. this.intLevel = 0;
  84. this.intLevels = 4;
  85. gotoAndPlay(4);
  86.